package org.zjvis.graph.analysis.service.exception;

import lombok.Getter;

/**
 * @description 通用异常code
 * @date 2020-03-26
 */
@Getter
public enum BaseErrorCode implements ErrorCode {

    /**
     * undefined error
     */
    UNAUTHORIZED(401, "无权访问!"),

    PLUGIN_REGISTER_ERROR(10001, "插件注册失败"),

    COOKIE_INVALID(20001, "登录信息失效"),
    PROJECT_NO_AUTH(31000, "无此项目操作权限"),

    HTTP_ERROR(30001, "与主平台通信发生错误"),
    HEALTHY_CHECK_ERROR(30002, "中间件连接测试异常"),

    /** graph */
    GRAPH_FILTER_ERROR(90006, "部分过滤器已失效，无法运行"),
    GRAPH_DEV_TIP(90008, "数据变动，请重新导入数据"),
    GRAPH_NO_PERMISSION(90009, "无权操作"),
    GRAPH_PROJECT_RELATION_ERROR(90017, "该视图不属于此项目"),
    GRAPH_FILTER_PIPELINE_RELATION_ERROR(90018, "该过滤器组不属于此视图"),
    GRAPH_FILTER_RELATION_ERROR(90019, "该过滤器不属于此过滤器组或视图"),
    ;

    Integer code;
    String msg;

    BaseErrorCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

}
